<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./lib/18/react.development.js"></script>
  <script src="./lib/18/react-dom.development.js"></script>
  <script src="./lib/babel.min.js"></script>

  <style>
    .title {
      color:aqua;
    }
  </style>
</head>
<body>
  <div id="app"></div>
  <script type="text/babel"> /* 声明使用babel进行编译 jsx => js*/
    let title = 'dddd'

    // 创建虚拟DOM   使用jsx
    let vdom = <h1 name='tom' className="title">标题内容</h1>
    vdom = (
      <div>
        <div>
          <h2 title='bbb'>{title}</h2>
          <p>cccc</p>
          <input type="text" />
        </div>
        <span>eeee</span>
      </div>
    )
    // 渲染虚拟DOM
    ReactDOM.createRoot(document.getElementById('app')).render(vdom)

    /* 
    注意:
    ● 必须有结束标签	
    ● 整个只能有一个根标签	
    ● 空标签可以自闭合
    */
  </script>
</body>
</html>